import pygame
import random

# Define some colors
black	= (0, 0, 0)
white	= (255, 255, 255)
green	= (0, 255, 0)
red	= (255, 0, 0)
blue	= (0, 0, 255)

# Initialize the game engine
pygame.init()

# Set the height and width of the screen
width	= 400
height	= 400
size 	= [width, height]
screen 	= pygame.display.set_mode(size)

pygame.display.set_caption("Title")

# Loop until the user clicks the close button
done = False
clock = pygame.time.Clock()

fps = 60

# Create an empty array for the start for the snow
star_list = []

star_count = 200

# Add star_count stars in random (x, y) positions
for i in range(star_count):
	x = random.randrange(0, 400)
	y = random.randrange(0, 400)
	star_list.append([x, y])

# ----- Main Program Loop -----
while not done:
	# For everything the user does
	for event in pygame.event.get():
		if event.type == pygame.QUIT:
			done = True

	# Set the screen background
	screen.fill(black)

	# ----- Begin Drawing Something -----

	# Process each star in the list
	for i in range(len(star_list)):
		pygame.draw.circle(screen, white, star_list[i], 2)

		# Move the start down one pixel
		star_list[i][1] += 1

		# Re-drop from the top if neccesary, change x
		if star_list[i][1] > 400:
			y = random.randrange(-50, -10)
			star_list[i][1] = y
			x = random.randrange(0, 400)
			star_list[i][0] = x

	# ----- End Drawing Something -----

	# Limit to fps frames per second
	clock.tick(fps)

	# Update the screen with what's been drawn
	pygame.display.flip()

# Exit.
pygame.quit()
